﻿using System;
using System.Collections;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using UploadClient.Interfaces.Plugins;

namespace ClipboardMonitoringPlugin
{
    class Configurations : IPluginConfig
    {
        readonly IHost host;
        private readonly Hashtable settings;
        private bool pluginEnabled = false;

        public Configurations(IHost host)
            : this(host, new Hashtable())
        {
        }

        public Configurations(IHost host, Hashtable settings)
        {
            this.host = host;
            this.settings = settings;
        }

        #region IPluginConfig Members

        public string PluginName
        {
            get { return Assembly.GetExecutingAssembly().GetName().Name.ToString(); }
        }

        public string Version
        {
            get { return Assembly.GetExecutingAssembly().GetName().Version.ToString(); }
        }

        public Guid Guid
        {
            get { return (Guid)Assembly.GetEntryAssembly().GetCustomAttributes(typeof(GuidAttribute), true).FirstOrDefault(); }
        }

        public bool PluginEnabled
        {
            get
            {
                return pluginEnabled;
            }
            set
            {
                pluginEnabled = value;
            }
        }

        public Hashtable Settings
        {
            get
            {
                return settings;
            }
        }

        #endregion

        #region IConfig Member

        public string DisplayText
        {
            get { return host.GetLocalizationRessourceString("Clipboard monitoring"); }
        }

        public string Hint
        {
            get { return host.GetLocalizationRessourceString("Adds screenshots from clipboard to upload queue."); }
        }

        #endregion
    }
}
